package cn.addr.user.model;

import java.io.Serializable;
import java.util.LinkedHashSet;
import java.util.Set;

@SuppressWarnings("serial")
public class UserBean implements Serializable{
	private Long id;
	private String uuid;
	private String username;
	private String password;
	private Set<LinkPerson> linkPersons = new LinkedHashSet<LinkPerson>();
	private Set<Tag>        tags		= new LinkedHashSet<Tag>();
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public Set<LinkPerson> getLinkPersons() {
		return linkPersons;
	}
	public void setLinkPersons(Set<LinkPerson> linkPersons) {
		this.linkPersons = linkPersons;
	}
	public Set<Tag> getTags() {
		return tags;
	}
	public void setTags(Set<Tag> tags) {
		this.tags = tags;
	}
	@Override
	public String toString() {
		return "UserBean [id=" + id + ", uuid=" + uuid + ", username="
				+ username + ", password=" + password + "]";
	}
	public UserBean(String username, String password) {
		super();
		this.username = username;
		this.password = password;
	}
	public UserBean() {
		super();
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((password == null) ? 0 : password.hashCode());
		result = prime * result
				+ ((username == null) ? 0 : username.hashCode());
		result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserBean other = (UserBean) obj;
		if (password == null) {
			if (other.password != null)
				return false;
		} else if (!password.equals(other.password))
			return false;
		if (username == null) {
			if (other.username != null)
				return false;
		} else if (!username.equals(other.username))
			return false;
		if (uuid == null) {
			if (other.uuid != null)
				return false;
		} else if (!uuid.equals(other.uuid))
			return false;
		return true;
	}
	
}
